package com.shkco.xbjcc.feign;

import com.shkco.result.JSONResult;
import com.shkco.xbjcc.domain.User;
import com.shkco.xbjcc.domain.UserIntegral;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient("service-user")
public interface UserService {

    @RequestMapping(value = "/user/{phone}",method = RequestMethod.GET)
    User findByPhone(@PathVariable("phone")String phone);


    @RequestMapping(value="/userIntegral/save",method= RequestMethod.POST)
    JSONResult saveOrUpdate(@RequestBody UserIntegral userIntegral);

    @RequestMapping(value = "/user/findById/{id}",method = RequestMethod.GET)
    User findById(@PathVariable("id")Long id);
}
